//
//  VisitorView.swift
//  LCYWeiBo
//
//  Created by 李长友 on 16/8/31.
//  Copyright © 2016年 app. All rights reserved.
//

import UIKit

class VisitorView: UIView {

    @IBOutlet weak var rotationView: UIImageView!
    @IBOutlet weak var iconView: UIImageView!
    @IBOutlet weak var promptLabel: UILabel!
    @IBOutlet weak var followButton: UIButton!
    @IBOutlet weak var registerButton: UIButton!
    @IBOutlet weak var loginButton: UIButton!
    
    func setupVisitorViewContent(iconName: String, title: String) {
        
        iconView.image = UIImage(named: iconName)
        promptLabel.text = title
        rotationView.hidden = true
        
        followButton.hidden = true
        registerButton.hidden = false
        loginButton.hidden = false
    }
    
    func setupAnimation() {
        
        let rotationAnimation = CABasicAnimation(keyPath: "transform.rotation.z")
        rotationAnimation.fromValue = 0
        rotationAnimation.toValue = M_PI * 2
        rotationAnimation.repeatCount = MAXFLOAT
        rotationAnimation.duration = 30
        rotationAnimation.removedOnCompletion = false
        rotationView.layer .addAnimation(rotationAnimation, forKey: nil)
    }
}
